{extend name="public/header" /}
{block name="body"}
<body>
{include file="public/common" /}
<!--头部搜索开始-->
<div class="layui-collapse" lay-accordion="">
	<div class="layui-colla-item">
		<h2 class="layui-colla-title">搜索</h2>
		<div class="layui-colla-content layui-show">
			<form class="layui-form" action="{:url('nav/index')}">
				<div class="layui-form">
					<div class="layui-inline">
						<div class="layui-input-inline">
							<input class="layui-input" name="id" value="{$pageMaps.id|default=''}" placeholder="ID">
						</div>
					</div>
					
					<div class="layui-inline">
						<button lay-submit class="layui-btn" lay-filter="search"><i class="layui-icon">&#xe615;</i>查找</button>
					</div>
				</div>
			</form>
		</div>
	</div>
</div>
<!--头部搜索结束-->
<div class="layui-form">
    <table class="layui-table" lay-size="sm">
        <thead>
        <tr>
            <th width="80">ID</th>
			<th>名称</th>
			<th>所属栏目</th>
			<th>栏目类型</th>
			<th>排序</th>
			<th>显示导航</th>
			<th>底栏副导</th>
			<th>状态</th>
            <th width="200">操作</th>
        </tr>
        </thead>
        <tbody>
		{if(count($list)<1)}
            <tr>
                <td colspan="9" align="center">暂无相关数据</td>
            </tr>
            {else /}
			{volist name='list' id='vo' key='k'}
			<tr>
				<td>{$vo.id}</td>
				<td>{$vo.name}</td>
				<td>顶级栏目</td>
				<td>
					{if $vo['type']==1}列表{/if}
					{if $vo['type']==2}单页{/if}
					{if $vo['type']==3}外链{/if}
				</td>
				<td>{$vo.sort}</td>
				<td><input type="checkbox" lay-skin="switch" lay-filter="switch" value="{$vo.ishow}" lay-text="显示|隐藏" {if $vo.ishow==1}checked{/if} data-url='{:url("ajax/upField",array("table"=>"nav","id_name"=>"id","id_value"=>$vo["id"],"field"=>"ishow"))}'></td>
				<td><input type="checkbox" lay-skin="switch" lay-filter="switch" value="{$vo.islow}" lay-text="显示|隐藏" {if $vo.islow==1}checked{/if} data-url='{:url("ajax/upField",array("table"=>"nav","id_name"=>"id","id_value"=>$vo["id"],"field"=>"islow"))}'></td>
				<td><input type="checkbox" lay-skin="switch" lay-filter="switch" value="{$vo.status}" lay-text="正常|禁用" {if $vo.status==1}checked{/if} data-url='{:url("ajax/upField",array("table"=>"nav","id_name"=>"id","id_value"=>$vo["id"],"field"=>"status"))}'></td>
				<td>
					<a class="layui-btn layui-btn-xs modal-catch" href="{:url('nav/info',array('id'=>$vo['id']))}">
						<i class="layui-icon">&#xe642;</i>编辑
					</a>
					<a class="layui-btn layui-btn-xs layui-btn-danger ajax-del" data-url='{:url("nav/del")}' data-field='id' data-value='{$vo.id}'>
						<i class="layui-icon">&#xe640;</i>删除
					</a>
				</td>
			</tr>
				{volist name="vo['voo']" id='sub' key='t'}
				<tr>
					<td>{$sub.id}</td>
					<td>&nbsp;&nbsp;├-&nbsp;&nbsp;{$sub.name}</td>
					<td>{$vo.name}</td>
					<td>
						{if $sub['type']==1}列表{/if}
						{if $sub['type']==2}单页{/if}
						{if $sub['type']==3}外链{/if}
					</td>
					<td>{$sub.sort}</td>
					<td><input type="checkbox" lay-skin="switch" lay-filter="switch" value="{$sub.ishow}" lay-text="显示|隐藏" {if $sub.ishow==1}checked{/if} data-url='{:url("ajax/upField",array("table"=>"nav","id_name"=>"id","id_value"=>$sub["id"],"field"=>"ishow"))}'></td>
					<td><input type="checkbox" lay-skin="switch" lay-filter="switch" value="{$sub.islow}" lay-text="显示|隐藏" {if $sub.islow==1}checked{/if} data-url='{:url("ajax/upField",array("table"=>"nav","id_name"=>"id","id_value"=>$sub["id"],"field"=>"islow"))}'></td>
					<td><input type="checkbox" lay-skin="switch" lay-filter="switch" value="{$sub.status}" lay-text="正常|禁用" {if $sub.status==1}checked{/if} data-url='{:url("ajax/upField",array("table"=>"nav","id_name"=>"id","id_value"=>$sub["id"],"field"=>"status"))}'></td>
					<td>
						<a class="layui-btn layui-btn-xs modal-catch" href="{:url('nav/info',array('id'=>$sub['id']))}">
							<i class="layui-icon">&#xe642;</i>编辑
						</a>
						<a class="layui-btn layui-btn-xs layui-btn-danger ajax-del" data-url='{:url("nav/del")}' data-field='id' data-value='{$sub.id}'>
							<i class="layui-icon">&#xe640;</i>删除
						</a>
					</td>
				</tr>
					{volist name="sub['voval']" id='voval' key='y'}
					<tr>
						<td>{$voval.id}</td>
						<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;├-&nbsp;&nbsp;{$voval.name}</td>
						<td>{$vo.name}</td>
						<td>
							{if $voval['type']==1}列表{/if}
							{if $voval['type']==2}单页{/if}
							{if $voval['type']==3}外链{/if}
						</td>
						<td>{$voval.sort}</td>
						<td><input type="checkbox" lay-skin="switch" lay-filter="switch" value="{$voval.ishow}" lay-text="显示|隐藏" {if $voval.ishow==1}checked{/if} data-url='{:url("ajax/upField",array("table"=>"nav","id_name"=>"id","id_value"=>$voval["id"],"field"=>"ishow"))}'></td>
						<td><input type="checkbox" lay-skin="switch" lay-filter="switch" value="{$voval.islow}" lay-text="显示|隐藏" {if $voval.islow==1}checked{/if} data-url='{:url("ajax/upField",array("table"=>"nav","id_name"=>"id","id_value"=>$voval["id"],"field"=>"islow"))}'></td>
						<td><input type="checkbox" lay-skin="switch" lay-filter="switch" value="{$voval.status}" lay-text="正常|禁用" {if $voval.status==1}checked{/if} data-url='{:url("ajax/upField",array("table"=>"nav","id_name"=>"id","id_value"=>$voval["id"],"field"=>"status"))}'></td>
						<td>
							<a class="layui-btn layui-btn-xs modal-catch" href="{:url('nav/info',array('id'=>$voval['id']))}">
								<i class="layui-icon">&#xe642;</i>编辑
							</a>
							<a class="layui-btn layui-btn-xs layui-btn-danger ajax-del" data-url='{:url("nav/del")}' data-field='id' data-value='{$voval.id}'>
								<i class="layui-icon">&#xe640;</i>删除
							</a>
						</td>
					</tr>
					{/volist}
				{/volist}
			{/volist}
		{/if}
        </tbody>
    </table>
</div>
</body>
{/block}
{block name="script"}
<script>
layui.use(['jquery','laydate','form','layajax','layer'], function(){
	var $ = layui.jquery
		,form = layui.form
		,laydate = layui.laydate
		,layer = layui.layer
		,layajax = layui.layajax;

	form.render();
});
</script>
{/block}